package com.zhangwei.fresco.apdater;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * @version V1.0
 * @description:
 * @title: Expands
 * @package com.zhangwei.fresco.apdater
 * @author: zhangwei
 * @date: 2015-12-23 下午5:43
 */
public class VpPageAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> fragments;

    public VpPageAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments != null ? fragments.size() : 0;
    }
}
